// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MainViewModel.cs" company="XamlmNinja">
//   2010
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace BingMaps.ViewModel
{
    using System;
    using GalaSoft.MvvmLight.Command;
    using GalaSoft.MvvmLight.Messaging;
    using WP7Contrib.Logging;
    using WP7Contrib.Services.Navigation;
    using WP7Contrib.Services.Storage;

    public class MainViewModel : ViewModelBaseWp7
    {
        #region Constants and Fields

        private RelayCommand selectLocationCommand;

        private RelayCommand selectRouteCommand;

        private RelayCommand selectImageryCommand;

        private RelayCommand selectSearchMapAreaCommand;

        #endregion

        #region Constructors and Destructors

        public MainViewModel(
            INavigationService navigationService, 
            IMessenger messenger, 
            IStorageService storageService, 
            ILog log)
            : base(navigationService, storageService, messenger, log)
        {
        }

        #endregion

        #region Properties

        public RelayCommand SelectLocationCommand
        {
            get
            {
                return this.selectLocationCommand ??
                       (this.selectLocationCommand =
                        new RelayCommand(() => this.NavigationService.Navigate(new Uri("/View/LocationPage.xaml", UriKind.Relative))));
            }
        }

        public RelayCommand SelectRouteCommand
        {
            get
            {
                return this.selectRouteCommand ??
                       (this.selectRouteCommand =
                        new RelayCommand(() => this.NavigationService.Navigate(new Uri("/View/RoutePage.xaml", UriKind.Relative))));
            }
        }

        public RelayCommand SelectImageryCommand
        {
            get
            {
                return this.selectImageryCommand ??
                       (this.selectImageryCommand =
                        new RelayCommand(() => this.NavigationService.Navigate(new Uri("/View/ImageryPage.xaml", UriKind.Relative))));
            }
        }


        public RelayCommand SelectBingSearchMapAreaCommand
        {
            get
            {
                return this.selectSearchMapAreaCommand ??
                       (this.selectSearchMapAreaCommand =
                        new RelayCommand(() => this.NavigationService.Navigate(new Uri("/View/SearchAreaPage.xaml", UriKind.Relative))));
            }
        }

        #endregion

        #region Methods

        protected override void IsBeingActivated(IStorage storage)
        {
        }

        protected override void IsBeingDeactivated(IStorage storage)
        {
        }

        #endregion
    }
}